package org.iblink.core.domain.model;

/**
 * 
 * <p>The <code>Category</code> class represents a folder in which assets are stored.</p>
 * 
 * @author tpares
 *
 */
public class Category {

  /**
   * The category technical identifier
   */
  private long id;
  
  /**
   * The category name
   */
  private String name;
  
  /**
   * The parent Category.
   */
  private Category parent;
  
  public String toString() {
    return getName();
  }
  
  /**
   * <p>Indicates whether or not this category is a root category.</p>
   * @return <code>true</code> if it is a root category, <code>false</code> otherwise
   */
  public boolean isRoot() {
    return parent == null;
  }

  /**
   * @return the id
   */
  public long getId() {
    return id;
  }

  /**
   * @param id the id to set
   */
  public void setId(long id) {
    this.id = id;
  }

  /**
   * @return the name
   */
  public String getName() {
    return name;
  }

  /**
   * @param name the name to set
   */
  public void setName(String name) {
    this.name = name;
  }

  /**
   * @return the parent
   */
  public Category getParent() {
    return parent;
  }

  /**
   * @param parent the parent to set
   */
  public void setParent(Category parent) {
    this.parent = parent;
  }
}
